1. Field of the Invention
The invention relates to a numerical prediction method, and more particularly to an error prediction method.
2. Description of the Related Art
In an image processing system, the image data often has to be halftone-processed in order to meet various demands of the output apparatuses. Taking a 24-bit image (true color) as an example, the gray-scale values of the red (R), green (G), and blue (B) pixels are represented by 8 bits. However, this representation cannot be directly displayed or printed. For example, each color in the LCD (liquid crystal display) only has 6 bits, and each color for printing only has one bit (three bits are used in an advanced printer). Consequently, the image processing system often needs to convert the image data with a higher bit number (e.g., 8) into another image data with a lower bit number (e.g., 6 or 3), which is the so-called halftone processing.
In the typical halftone processing, the gray-scale value of the pixel is compared to a threshold value. “1” is outputted if the gray-scale value is greater than the threshold value, or otherwise “0” is outputted. Although the method can be easily performed, image distortion may be caused because the error is too large. One of the improved methods is to diffuse the error of each pixel to the adjacent pixels according to a certain proportion, and thus the errors diffused from other pixels also have to be considered when the gray-scale values of the adjacent pixels are calculated. Therefore, the overall error is reduced, and the method is called as the error diffusion method.
FIG. 1 is a schematic illustration showing the error diffusion method. The pixels P11, P12 and P21 are adjacent to one another. According to the error diffusion principle, the error of the pixel P11 may be diffused to the pixels P12 and P21 according to a certain proportion (e.g., 50%), respectively. When the gray-scale values of the pixels P12 and P21 are calculated, the diffused errors from the pixel P11 have to be considered. In order to make the error diffusion condition be easily distinguished, the error of the pixel outputted along the horizontal axis (x-axis) direction is referred to as a transversal error EX, and the error of the pixel outputted along the vertical axis (y-axis) direction is referred to as a longitudinal error EY.
FIG. 2 shows the implementation condition of the error diffusion method for the image data. The image data 200 is a full image composed of plural adjacent image rows, wherein only two rows are representatively illustrated in the drawing. If the resolution of the image data 200 is 1024×768, it means that the image data has 768 image rows, and each image row has 1024 pixels. When the error diffusion method is performed, the errors of the pixels in each image row will be sequentially diffused along the error diffusion direction. After the errors of all of the pixels have been diffused, the error diffusion for the next image row is performed. Taking this figure as an example, the error of the pixel A in the image row 210 is diffused rightward to the pixel B, the error of the pixel B is calculated by considering the error from the pixel A, and then the calculated error is diffused to the next pixel. The error of each pixel in the image row 210 is generated and diffused outward in this way. After the calculation of the last pixel M is completed, the error diffusion for the image row 220 is performed. The core of the prior art method is to switch to a next image row for the error diffusion operations after all pixels in each image row have been completely diffused. That is, the image row serves as the calculation unit, or the method may be called as a line-based method.
It is to be noted that the transversal error of each pixel is generated and diffused along the horizontal axis, and the longitudinal error of each pixel is also generated and diffused along the vertical axis. Because the error diffusion has to be performed row by row, the transversal error may be immediately processed after it is diffused to the next pixel, but the longitudinal errors have to be temporarily stored to a memory in advance and the longitudinal errors of the previous image row are considered after the errors of the next image row are calculated. Taking FIG. 1 as an example, the longitudinal error of the pixel P11 has to be stored in advance, and then be considered when the error of the pixel P21 is calculated. Consequently, the system needs a large memory to store the longitudinal errors of all pixels in a whole image row, which is quite uneconomic to the hardware usage.